# models.py
from flask_sqlalchemy import SQLAlchemy

# 初始化SQLAlchemy对象（不绑定app，后续在app.py中关联）
db = SQLAlchemy()


# 用户表模型
class User(db.Model):
    __tablename__ = "user"
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(30), unique=True, nullable=False)
    email = db.Column(db.String(50), unique=True, nullable=False)
    password = db.Column(db.String(128), nullable=False)
    student_id = db.Column(db.Integer, nullable=False)
    class_id = db.Column(db.Integer, nullable=False)
